package com.huluobo.lib_http

import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import java.util.concurrent.TimeUnit

/**
 *  Created by LC on 2025/2/5.
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjM5OCwiY3RpbWUiOjE3Mzg5MDcwMzJ9.pVmZl2hXpf0JMTSkzfkvM9ZKhjaYsXSG-TZKNQEkroI"
 *
 */
abstract class BaseRetrofitImpl : HttpRetrofit {
    fun createHttp(): OkHttpClient.Builder {
        return OkHttpClient.Builder()
            .connectTimeout(10, TimeUnit.SECONDS)
            .writeTimeout(10, TimeUnit.SECONDS)
            .readTimeout(10, TimeUnit.SECONDS)
//            .addInterceptor { chain ->
//                chain.proceed(
//                    chain.request().newBuilder()
//                        .addHeader(
//                            Const.PARAM_TOKEN,
//                            "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOjM5OCwiY3RpbWUiOjE3Mzg5MDcwMzJ9.pVmZl2hXpf0JMTSkzfkvM9ZKhjaYsXSG-TZKNQEkroI"
//                        )
//                        .build()
//                )
//            }
            .addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
    }
}